﻿using B.S.AuthCenter.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.AuthCenter.InfrasIntructure.Interface
{
    /// <summary>
    /// 仓储层接口
    /// </summary>
    /// <typeparam name="T">数据类型</typeparam>
    public interface IBaseRepository<T> where T : BaseEntity
    {
        /// <summary>
        /// 添加数据
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns>返回受影响的行数</returns>
        Task<int> Add(T entity);
        /// <summary>
        /// 修改数据
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns>返回受影响的行数</returns>
        Task<int> Update(T entity);
        /// <summary>
        /// 查询所有数据
        /// </summary>
        /// <returns>返回查询到的数据</returns>
        IQueryable<T> GetAll();
        Task<int> AddAll(IList<T> t);
        Task<int> UpdateAll(IList<T> t);
        Task<T> GetValue(int id);
    }
}
